[clang-tidy] Prohibit the use of the C standard library for character classification
Categories
(Developer Infrastructure :: Source Code Analysis, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: hsivonen, Assigned: freddy)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Comment 1•7 years ago
|
||
Reporter | ||
Comment 2•7 years ago
|
||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Work in progress. I don't know how to add exceptions for existing code. Is
there an existing lint that has something like that?
Comment 8•5 years ago
|
||
There are several copies of gtest in our tree, all listed in tools/rewriting/ThirdPartyPaths.txt
. Nevertheless, they are triggering these warnings as though they were first-party code, because we link them into the OBJDIR:
$OBJDIR/dist/include/gtest/internal/gtest-port.h -> $SRCDIR/testing/gtest/gtest/include/gtest/internal/gtest-port.h
Is this a known issue?
Comment 9•5 years ago
|
||
Yes, please see this workaround https://searchfox.org/mozilla-central/source/build/clang-plugin/CustomMatchers.h#137
Updated•5 years ago
|
Comment 10•5 years ago
|
||
Depends on D81785
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Backed out for bustages on TestNoLocaleSpecificChecker.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/2f02cadc189cd3b46183ddcacad2171a8e3fef93
Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=310374949&repo=autoland&lineNumber=8431
Comment 13•5 years ago
|
||
Hmm. strcasecmp
doesn't exist on Windows. By far the easiest thing is to delete that particular part of the test, so I guess I'll do that.
![]() |
||
Comment 14•5 years ago
|
||
(In reply to Jason Orendorff [:jorendorff] from comment #13)
Hmm.
strcasecmp
doesn't exist on Windows. By far the easiest thing is to delete that particular part of the test, so I guess I'll do that.
Does that mean we should be checking for the Windows equivalents as well?
Reporter | ||
Comment 15•5 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #14)
Does that mean we should be checking for the Windows equivalents as well?
It indeed appears that we should block _stricmp
, _wcsicmp
, and _mbsicmp
, too.
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•